function add(x: number, y: number): number {
    return x + y;
}

const result: number = add(10, 20)


const fun = (callback: (x: number, y: number) => void): void => {
    callback(10, 20)
}

fun((x, y) => {
    console.log(x, y)
})


type CalcType = (num1: number, num2: number) => number
function foo(callback: CalcType) {
    const res:number = callback(10, 20)
    console.log(res)
}

foo((num1, num2) => {
    return num1 + num2
})
